// run: $exec < input
#include <iostream>
#include <set>

int const opt[] = {5, 7, 5};
std::set<char> dict{'a', 'e', 'i', 'o', 'u'};
int n;

int main()
{
	std::ios::sync_with_stdio(false);
	for (int i = 0; i < 3; i++) {
		int count = 0;
		std::string s;
		std::getline(std::cin, s);
		for (auto i : s)
			count += (dict.find(i) != dict.end());
		if (count != opt[i]) {
			std::cout << "NO\n";
			return 0;
		}
	}
	std::cout << "YES\n";
}

